﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "GcmpGraphicsNodeInterface.h"
#include "IGraphicsNode.h"

namespace gcmp
{
    class IGraphicsNode;

    /// \brief 图形节点组
    class GCMP_GRAPHICS_NODE_INTERFACE_EXPORT IGraphicsNodeList : public IDbObject
    {
        DEFINE_CAST_DERIVED(IGraphicsNodeList, IDbObject)

    public:
        /// \brief 析构器
        virtual ~IGraphicsNodeList();

    public:
        /// \brief 增加一个图形节点
        /// \param opNode 图形节点
        /// \return 无    
        virtual void AddItem(OwnerPtr<IGraphicsNode> opNode) = 0;

        /// \brief 获取图形节点数目
        /// \return 图形节点数目
        virtual int GetCount() const = 0;

        /// \brief 根据索引获取图形节点
        /// \param index 索引
        /// \return 获取的图形节点
        virtual const IGraphicsNode* GetItemByIndex(int index) const = 0;

        /// \brief 根据索引获取图形节点
        /// \param index 索引
        /// \return 获取的图形节点
        virtual IGraphicsNode* GetItemByIndexFW(int index) = 0;

    public:
        /// \brief 创建默认的图形节点组
        /// \return 图形节点组
        static OwnerPtr<IGraphicsNodeList> Create();
    };
}
